<%--
  Created by IntelliJ IDEA.
  User: zzz
  Date: 2020/2/6
  Time: 19:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
</head>
<body>
<div class="gotop">
    <a href="${APP_PATH}/${sessionScope.user == null? "toPortalLogin" : "toTrolley"}">
        <dl class="goCart">
            <dt><img src="${APP_PATH}/portal/img/gt1.png"/></dt>
            <dd>去购<br />物车</dd>
            <span id="preCount" hidden></span>
        </dl>
    </a>
    <a href="#" class="dh">
        <dl>
            <dt><img src="${APP_PATH}/portal/img/gt2.png"/></dt>
            <dd>联系<br />客服</dd>
        </dl>
    </a>
    <a href="${APP_PATH}/${sessionScope.user == null?"toPortalLogin":"toUser"}">
        <dl>
            <dt><img src="${APP_PATH}/portal/img/gt3.png"/></dt>
            <dd>个人<br />中心</dd>
        </dl>
    </a>
    <a href="#" class="toptop" style="display: none">
        <dl>
            <dt><img src="${APP_PATH}/portal/img/gt4.png"/></dt>
            <dd>返回<br />顶部</dd>
        </dl>
    </a>
    <p>400-800-8200</p>
</div>
</body>
</html>
<script src="${APP_PATH}/portal/js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(function () {
        if(${sessionScope.user != null}){
        getPreCount();
        }
    });

    function getPreCount() {
        $.ajax({
            url : "${APP_PATH}/order/getPreCount",
            method : "GET",
            data : {
                uid : '${sessionScope.user.uid}'
            },
            success : function (result) {
                if(result.success){
                    if(result.data > 0){
                        $("#preCount").html(result.data);
                        $("#preCount").show();
                    }else{
                        $("#preCount").hide();
                    }

                }
            }
        });
    }
</script>